import http from "@/utils/http";

/**
 * 登陆
 *
 * @param data {Captcha}
 * @returns
 */

export const login = data => {
  return http.request({
    url: "/login",
    method: "post",
    data,
    duplicateRequestValidation: true // 重复请求限制
  });
};

/**
 * 聊天
 *
 * @param data {Captcha}
 * @returns
 */

export const getASK = params => {
  return http.request({
    url: "/ask",
    method: "get",
    params,
    duplicateRequestValidation: true // 重复请求限制
  });
};

/**
 * 测试指令
 *
 * @param data {Captcha}
 * @returns
 */

export const postTest = data => {
  return http.request({
    url: "/monitoring/test",
    method: "post",
    data,
    duplicateRequestValidation: true // 重复请求限制
  });
};

/**
 * 测试指令
 *
 * @param data {Captcha}
 * @returns
 */

export const postAdd = data => {
  return http.request({
    url: "/monitoring/add",
    method: "post",
    data,
    duplicateRequestValidation: true // 重复请求限制
  });
};

/**
 * 测试指令
 *
 * @param data {Captcha}
 * @returns
 */

export const getList = params => {
  return http.request({
    url: "/monitoring/list",
    method: "get",
    params,
    duplicateRequestValidation: true // 重复请求限制
  });
};

/**
 * 删除指令
 *
 * @param data {Captcha}
 * @returns
 */

export const postDelete = data => {
  return http.request({
    url: "/monitoring/delete",
    method: "post",
    data,
    duplicateRequestValidation: true // 重复请求限制
  });
};

/**
 * 轮询指令
 *
 * @param data {Captcha}
 * @returns
 */

export const getSelect = params => {
  return http.request({
    url: "/monitoring/select",
    method: "get",
    params,
    duplicateRequestValidation: false // 重复请求限制
  });
};
